calculate power using recursion